package com.yuju.account.enums;


public enum AccountReturnCodeEnum {
	
	ACCOUNT_QUERY_SUCCESS("yuju-account-1001", "账务信息查找成功"),
	ACCOUNT_QUERY_FAILURE("yuju-account-1002", "账务信息查找失败"),
	ACCOUNT_SAVE_SUCCESS("yuju-account-1003", "账务信息新增成功"),
	ACCOUNT_SAVE_FAILURE("yuju-account-1004", "账务信息新增失败"),
	ACCOUNT_UPDATE_SUCCESS("yuju-account-1005", "账务信息更新成功"),
	ACCOUNT_UPDATE_FAILURE("yuju-account-1006", "账务信息更新失败"),
	ACCOUNT_DESPOITYUPDATE_FAILURE("yuju-account-1007", "预订金更新失败"),
	ACCOUNT_ORDERBALANCEUPDATE_FAILURE("yuju-account-1008", "订单余额更新失败"),
	ACCOUNT_ROOMBALANCEUPDATE_FAILURE("yuju-account-1009", "客账余额更新失败"),
	ACCOUNT_STATUS_NOMATCH("yuju-account-1010", "账务状态不匹配"),
	ACCOUNT_ATTRIBUTE_NULL_ERR("yuju-account-1011", "账务基本信息为NULL错误"),
	ACCOUNT_NOTHING("yuju-account-1012", "无数据"),
	ACCOUNTREPORT_QUERY_SUCCESS("yuju-account-1013", "账务报表信息查找成功"),
	ACCOUNTREPORT_QUERY_FAILURE("yuju-account-1014", "账务报表信息查找失败"),
	ACCOUNT_AMOUNTQUERY_SUCCESS("yuju-account-1015", "账务总数量查找成功"),
	ACCOUNT_AMOUNTQUERY_FAILURE("yuju-account-1016", "账务总数量查找失败"),
	CTREPORT_QUERY_SUCCESS("yuju-account-1017", "冲调报表信息查找成功"),
	CTREPORT_QUERY_FAILURE("yuju-account-1018", "冲调报表信息查找失败"),
	CTSUM_QUERY_SUCCESS("yuju-account-1019", "冲调总金额查找成功"),
	CTSUM_QUERY_FAILURE("yuju-account-1020", "冲调总金额查找失败");
	
	private String code;
	private String desc;
	
	AccountReturnCodeEnum(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	
	public static String getDescByCode(String code) {
		for (AccountReturnCodeEnum enume : AccountReturnCodeEnum.values()) {
			if (enume.getCode().equals(code)) {
				return enume.getDesc();
			}
		}
		
		return "未知枚举类型";
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
}
